<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ page import="com.alpha.bom.*, java.util.ArrayList" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="display" uri="http://displaytag.sf.net"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Exam Report</title>
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/displaytag.css"/>

</head>
<body>

	<c:set var="examResponses" value="${requestScope.exam_responses}"></c:set>
	<c:set var="examName" value="${requestScope.exam_name }"></c:set>

	<div id="header"><%@ include file="Header.jsp"%></div>
	<div id="content">
	<div id="navbar"><%@ include file="NavigationBar.jsp"%></div>
	
	<div id="main">
		
			<div class="box">
				<div class="box-header well">
					<h2><i class="icon-user"></i> ${examName}</h2>
					<div class="box-icon">
						<a href="#" class="btn btn-minimize btn-round"><i class="icon-chevron-up"></i></a>
					</div>
				</div>
				<div class="box-content">
					<display:table id="examResponse" name="${examResponses}" export="true" class="table table-striped table-bordered bootstrap-datatable datatable">
						<display:column property="student.userId" title="Examinee ID"/>
						<display:column title="Examinee Name">${examResponse.student.firstName} ${examResponse.student.lastName}</display:column>
						<display:column property="dateTaken" title="Date Taken"/>
						<display:column title="Score">${examResponse.computeScore()}/${examResponse.exam.questions.size() }</display:column>
						<display:column media="html" title="Action">
							<a class="btn btn-info" href="StudentResponseServlet?exam_response_id=${examResponse.examResponseId}"><i class=" icon-info-sign"></i> View Responses</a>
						</display:column>
						
						<display:caption media="pdf excel csv xml rtf">${examName} Results</display:caption>
						
						<display:setProperty name="export.pdf" value="true"/>
						<display:setProperty name="export.pdf.filename" value="export.pdf"/>
						<display:setProperty name="export.excel.filename" value="export.xls"/>
						<display:setProperty name="export.csv.filename" value="export.csv"/>
						<display:setProperty name="export.xml.filename" value="export.xml"/>
						><display:setProperty name="export.rtf.filename" value="export.rtf"></display:setProperty>
					</display:table>
				</div>
			</div>
		</div>

	</div>

<script>
	$(document).ready(function() {
		$("span[class*='export']").parent().each(function() {
			this.href = this.href.replace("ExamReport.jsp", "ExamReportServlet");
		});
	});
</script>
</body>
</html>